package com.community.process._1010.dao.vo;

import com.community.process._1010.common.utils.SystemAmountUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @Description:
 * @Author: Administrator to Zbs
 * @Date: 2024/9/6 星期五 13:59
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class ProcessIngredientsVo {

    @Schema(description = "ID")
    private Long id;

    @Schema(description = "食材名称")
    private String name;

    @Schema(description = "分类ID")
    private Long categoryId;

    @Schema(description = "分类ID")
    private String categoryName;

    @Schema(description = "组合最小数量")
    private Integer min;

    @Schema(description = "组合最大数量")
    private Integer max;

    @Schema(description = "食材图片")
    private String image;

    @Schema(description = "食材最小单位加工费 单位：分")
    private BigDecimal processingFee;

    @Schema(description = "食材最小单位价格 单位：元")
    private BigDecimal price;

    @Schema(description = "单位")
    private String units;

    @Schema(description = "单位数量")
    private Integer unitsNum;

    @Schema(description = "上下架 1 上架 0 下架")
    private Integer up;

    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    public void setPrice(Long price) {
        this.price = SystemAmountUtil.pennyToYuan(price);
    }

    public void setProcessingFee(Long processingFee) {
        this.processingFee = SystemAmountUtil.pennyToYuan(processingFee);
    }
}
